var Asale;
Asale = function(obj){	return Asale.anew(obj);}
Asale.anew = function(obj){this.obj=obj;	return this;}

Asale.search = function(obj){	return Asale.search.anew(obj);}
Asale.search.anew = function(obj){this.obj=obj;	return this;}
//--搜索用户
Asale.search.user = function(){
	var save = jQuery("#Asale_key").serialize();
	jQuery.ajax({type: "POST",url: Aurl.Amodr+"-search",data: save,
		beforeSend: function(){Acan.alert('开始请求');},
		ajaxSend: function(){Acan.alert('发送请求');},
		success: function(data){
			if(typeof(data)=='object'){
				if(data.error==1){
					Acan.alert(data.msg,2000);
					jQuery("#Asale_search_data").html('');
				}else{
					Acan.alert();
					jQuery("#Asale_search_data").html(data.msg);
				}
			}else{
				Acan.alert();
				jQuery("#Asale_search_data").html(data);
			}
		}
	})
	return false;
}
Asale.user = function(obj){	return Asale.user.anew(obj);}
Asale.user.anew = function(obj){this.obj=obj;	return this;}
Asale.user.add = function(){
	var save = jQuery("#Asale_user_add").serialize();
	jQuery.ajax({type: "POST",url: Aurl.Amodr+"-save_user",data: save,
		beforeSend: function(){Acan.alert('开始请求');},
		ajaxSend: function(){Acan.alert('发送请求');},
		success: function(data){
			if(typeof(data)=='object'){
				if(data.error==1){
					Acan.alert(data.msg,2000);
					jQuery("#Asale_search_data").html('');
				}else{
					Acan.alert();
					jQuery("#Asale_search_data").html(data.msg);
				}
			}else{
				Acan.alert();
				jQuery("#Asale_search_data").html(data);
			}
		}
	})
	return false;
}
Asale.user.addinfo = function(){
	var type = jQuery("input[name='add_type']:checked").val();
	var title = add_type[type];
	var note = jQuery(".-user_add .-add_note").val();
	if(!note){Acan.alert('内容为空!'); return false;}
	var htm = Ahtml.tag('input',{'type':'text','name':'save_info['+type+'][]','value':note},'<dt>'+title+':</dt><dd>')+'</dd>';
	jQuery(".-user_add .-add_info").append(htm);
}


